home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / AIFF_DSP_v15 folder / AIFF_DSP / sintab.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-08  |  1.0 KB  |  36 lines  |  [TEXT/KAHL]

  1. #pragma once
  2. /*
  3. FILE:    sintab.h
  4. PROJECT: Ford grant DSP
  5. AUTHOR:  Ben Denckla
  6. COMMENT: constants, externs, and function declarations
  7.          for sine table routines
  8. */
  9.  
  10. #define QSIZLOG2 9                // quadrant size LOG base 2. (1)
  11. #define QSIZ     (1U << QSIZLOG2) // quadrant size
  12. #define TABMASK  (4*QSIZ - 1)     // 4-quadrant sine table mask
  13.                                   // x & TABMASK == x % 4QSIZ
  14. /*
  15. 1. QSIZLOG2 must be <= 13 in order to address the whole 4-quadrant sine
  16.    table with a short since the max of a short is 1<<15 - 1.  See
  17.    get_sintab4() in "sintab.c".
  18. */
  19.  
  20. #define GETNUMRANGE( prompt, printfmt, scanfmt, x, min, max ) { \
  21.     int e; \
  22.     do { \
  23.         printf( prompt " (" printfmt "..." printfmt "): ", min, max ); \
  24.         e = !scanf( scanfmt, &(x) ) || (x) < (min) || (x) > (max); \
  25.         fflush( stdin ); \
  26.         if ( e ) puts( "Try again: input was bad." ); \
  27.     } while ( e ); \
  28. }
  29.  
  30. short  getusrharm  ( void );
  31. void   get_sintab  ( void );
  32. short *gen_sintab4 ( void );
  33. short  sin_tab     ( short tabi );
  34. short  fsin_tab    ( double *fsamnum );
  35.  
  36.